const  promisic = function (func) { //wx.request
    return function (params = {}) {
       return new Promise((resolve,reject)=>{
         const args = Object.assign(params,{
           success:(res)=>{
             resolve(res)
           },
           fail:(err)=>{
             reject(err)
           }
         })
         
         
         func(args)
       })
    }
}

p1 = new Promise((resolve,reject)=>{
    wx.requestc({
      url:'http://127.0.0.1:3003/petall',
      data:{
        a:1
      },
      method:'POST',
         header:{
        "Content-Type":"application/json"
      },
      success:(res)=>{
        resolve(res)
      }
    })
  })

let p = new Promise((resolve,reject)=>{
    setTimeout(() => {
        resolve('helloworld')
    }, 3000);
 })
 p.then((res)=>{
     console.log(res)
 })